<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/tag/c.tld"%>
<div id="dbConfigTableFieldEdit">
<form action="${webRoot}/dbConfig/table/field/save" method="post">
	<input type="hidden" name="projectCode" value="${project.projectCode}"/>
	<input type="hidden" name="tableName" value="${table.tableName}"/>
	<input type="hidden" name="id" value="${field.code}"/>
	<div class="form-group">
    	<label>字段代码</label>
    	<input type="text" class="form-control" name="code" value="${field.code}"/>
  	</div>
  	<div class="form-group">
    	<label>字段名称</label>
    	<input type="text" class="form-control" name="name" value="${field.name}"/>
  	</div>
  	<div class="form-group">
    	<label>字段类型</label>
    	<select name="type" class="form-control">
    		<option value="String" <c:if test="${'String'==field.type}">selected</c:if>>String</option>
    		<option value="Long" <c:if test="${'Long'==field.type}">selected</c:if>>Long</option>
    		<option value="Integer" <c:if test="${'Integer'==field.type}">selected</c:if>>Integer</option>
    		<option value="Date" <c:if test="${'Date'==field.type}">selected</c:if>>Date</option>
    		<option value="Float" <c:if test="${'Float'==field.type}">selected</c:if>>Float</option>
    		<option value="Double" <c:if test="${'Double'==field.type}">selected</c:if>>double</option>
    		<option value="Boolean" <c:if test="${'Boolean'==field.type}">selected</c:if>>Boolean</option>
    	</select>
  	</div>
  	<div class="form-group">
    	<label>字段长度</label>
    	<input type="text" class="form-control" name="length" value="${field.length}"/>
  	</div>
  	<div class="form-group clearfix">
    	<div class="checkbox col-md-4">
			<label><input type="checkbox" name="isKey" value="true" <c:if test="${field.isKey}">checked</c:if>>是否是主键</label>
		</div>
		<div class="col-md-4">
		<div class="checkbox">
			<label><input type="checkbox" name=isNullable value="true" <c:if test="${field.isNullable}">checked</c:if>>是否可为空</label>
		</div>
		</div>
  	</div>
  	<div class="form-group clearfix">
	    <button type="button" class="btn btn-success pull-right">完成</button>
  	</div>
</form>
<script type="text/javascript">
$(function(){
	$('#dbConfigTableFieldEdit .btn-success').click(function(){
		$('#dbConfigTableFieldEdit form').jfForm('submit',function(result){
			jf.modalCallback($('#dbConfigTableFieldEdit'),result);
		});
	});
});
</script>
</div>